home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_explodingdebris.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  87 lines

  1. # Jones 3d Cog Script
  2. #
  3. # gen_ExplodingDebris.cog
  4. #
  5. # Generic debris/sub explosions generation script
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     message     activate
  14.     message     startup
  15.     
  16.     thing       player                  local    
  17.     thing       button                  desc=hit_this_thing
  18.     thing        bombpos                 desc=explode_thing
  19.     thing       victim                  desc=the thing youre blowing up
  20.     thing       bombcampos              desc=position for bombcam
  21.     int            pieces=40                desc=num_debris
  22.  
  23.     int            i                        local
  24.     int            fragment                local        
  25.  
  26.     template    debris0         
  27.     template    debris1           
  28.     template    debris2         
  29.     template    debris3         
  30.     template    debris4
  31.             
  32.     vector      liteval                 local
  33.     vector      nolite                  local
  34.  
  35.     int            dummy                    local
  36.     int         hitit=0                 local
  37.  
  38.     sound        explode_snd=gen_shotgun_fire.wav    local
  39.     sound       charging=nub_aethlight_on_c.wav       local
  40.  
  41. end
  42. # ========================================================================================
  43.  
  44. code
  45.  
  46. startup:
  47.     player=GetLocalPlayerThing();
  48.     liteval=VectorSet(0.25, 0.55, 1.0);
  49.     nolite=VectorSet(0, 0, 0);
  50.     return;
  51.     
  52. # ========================================================================================
  53. activate:
  54.     if ((GetSenderRef() == button) && (hitit == 0))
  55.     {
  56.         hitit=1;
  57.         StartCutscene(1);
  58.         SetActorFlags(player, 0x200000);
  59.         SetCameraFocus(0, bombcampos);
  60.         SetCurrentCamera(0);
  61.         SetCameraFOV(120, 1, 3.0);
  62.         PlaySoundThing(charging, victim, 1.0, 10.0, 20.0, 0);
  63.         SetThingLight(player, liteval, 2.0);
  64.         Sleep(3);                                                                                        
  65.         dummy = PlaySoundThing(explode_snd, bombpos, 1.0, 10.0, 20.0, 0);
  66.         for(i=0; i<pieces; i=i+1)                                                                        
  67.         {                                                                                                    
  68.             fragment = CreateThing(debris0[RandBetween(0, 4)], bombpos);                                 
  69.             SetThingVel(fragment, VectorScale(VectorAdd(RandVec(), '-0.5 -0.5 0.0'), 2));
  70.             SetThingRotVel(fragment, VectorScale(VectorAdd(RandVec(), '0.0 0.0 0.0'), 900.0));                    
  71.         }                                                                                                    
  72.         DestroyThing(victim);
  73.         sleep(1);
  74.         SetThingLight(player, nolite, 2.0);
  75.         SetCameraFocus(1, player);
  76.         SetCameraFOV(90, 0, 0);
  77.         SetCurrentCamera(1);
  78.         ClearActorFlags(player, 0x200000);                                                                     
  79.         EndCutscene();
  80.     }
  81.     return;
  82.     
  83. # ========================================================================================                                                                                          
  84.  
  85. end
  86.  
  87.